22fea5a787fcabd1953b2ff86f18343be1cca5e3,dotCMS/src/integration-test/java/com/dotmarketing/quartz/job/DeleteFieldJobTest.java,DeleteFieldJobTest,deleteContentTypeFieldNewTest,#,218
Before Change
String contentInode = rs.getString("inode");
inodesToFlush.add(contentInode);
Logger.info(this, "----------------------------------------");
Logger.info(this, "contentInode value = " + contentInode);
Logger.info(this, "----------------------------------------");
ps2.setString(1, contentInode);
ps2.addBatch();
After Change
} catch (SQLException e) {
Logger.info(this, "********************************************");
Logger.info(this, "********************************************");
Logger.info(this, "");
Logger.info(this, "Error retrieving the fields to delete, step #1");
Logger.info(this, "");
Logger.info(this, "********************************************");
Logger.info(this, "********************************************");
throw new DotDataException("Error retrieving the fields to delete, step #1", e);
} finally {
conn.close();
}
conn = DbConnectionFactory.getConnection();
try (PreparedStatement ps2 = conn.prepareCall(queries.getUpdate())) {
final int BATCH_SIZE = 200;
int i = 1;
for (String contentInode : contentInodes) {
inodesToFlush.add(contentInode);
Logger.info(this, "========================================");
Logger.info(this, "-> SETTING THE PREPARED STATEMENT PARAMETER...");
Logger.info(this, "========================================");
ps2.setString(1, contentInode);
ps2.addBatch();
if (i % BATCH_SIZE == 0) {
ps2.executeBatch();
}
i++;
}
ps2.executeBatch(); // insert remaining records
} catch (SQLException e) {
Logger.info(this, "********************************************");
Logger.info(this, "********************************************");
Logger.info(this, "");
Logger.info(this, "Error retrieving the fields, step #2");
Logger.info(this, "");
Logger.info(this, "********************************************");
Logger.info(this, "********************************************");
throw new DotDataException(String.format("Error clearing field '%s' for Content Type with ID: %s",
textAreaField.getVelocityVarName(), structureInode), e);
} finally {